package com.lightsaber.trade.cloth.dao.planning;

import java.util.HashMap;
import java.util.Map;

import org.hibernate.Query;
import org.springframework.stereotype.Component;

import com.lightsaber.trade.core.dao.BaseDao;
import com.lightsaber.trade.cloth.entity.planning.ResourceGroupItem;

@Component
public class ResourceGroupItemDao extends BaseDao<ResourceGroupItem, String> {

    public void deleteByResourceGroupId(final String resourceGroupId) {
        String hql = "delete from ResourceGroupItem where resourceGroup.id=:resourceGroupId";
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("resourceGroupId", resourceGroupId);
        Query q = this.createQuery(hql, map);
        q.executeUpdate();
    }

}
